Public Class frmNewReport

    Private strFilename As String

    Public ReadOnly Property Filename() As String
        Get
            Return Me.strFilename
        End Get
    End Property

    Public ReadOnly Property ReportName() As String
        Get
            Return Me.txtReportName.Text
        End Get
    End Property

    Public ReadOnly Property Overwrite() As Boolean
        Get
            Return Me.cbOverwrite.Checked
        End Get
    End Property

    Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
        If Me.ofReport.ShowDialog = Windows.Forms.DialogResult.OK Then
            Me.strFilename = Me.ofReport.FileName
            Me.txtReport.Text = Me.strFilename
            Dim fi As New System.IO.FileInfo(strFilename)
            Me.txtReportName.Text = fi.Name.Substring(0, fi.Name.LastIndexOf("."))
        End If
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.DialogResult = Windows.Forms.DialogResult.OK
    End Sub

    Private Sub frmNewReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtReportName.Select()
    End Sub
End Class